catvm.memory.MimeTypeArray = {}
var MimeTypeArray = function MimeTypeArray() {
    //如果不能new  要抛出一个错误
    throw new TypeError("Illegal constructor");
}//构造函数
catvm.safefunction(MimeTypeArray); //tostring 保护
//内存存储  为了保护非全局函数
catvm.memory.MimeTypeArray.iterator = function values() {
    debugger;

};
catvm.safefunction(catvm.memory.MimeTypeArray.iterator); //tostring 保护

//设置原型链上显示的名字***************************************************************************
Object.defineProperties(MimeTypeArray.prototype, {
    [Symbol.toStringTag]: {
        value: "MimeTypeArray",
        configurable: true
    },
    [Symbol.iterator]: {
        value: catvm.memory.MimeTypeArray.iterator,
        configurable: true
    }
});

//该环境下的属性和方法***************************************************************************
MimeTypeArray.prototype.length = 0;
MimeTypeArray.prototype.item = function item(i) {
    debugger;
    return this[i]
};
catvm.safefunction(MimeTypeArray.prototype.item);
MimeTypeArray.prototype.namedItem = function namedItem(i) {
    debugger;
    return this[i]
};
catvm.safefunction(MimeTypeArray.prototype.namedItem);

//new出来的实例在没有继承的情况下获取是报错情况/
for (var pluginKey in MimeTypeArray.prototype) {
    if (typeof (MimeTypeArray.prototype[pluginKey]) != 'function') {
        MimeTypeArray.prototype.__defineGetter__(pluginKey, function () {
            throw new TypeError("Illegal constructor");
        })
    }
}

navigator.mimeTypes = {}
navigator.mimeTypes.temp = 0
for (let i = 0; i < navigator.plugins.length; i++) {
    var plugin_ = navigator.plugins.item(i)
    for (let j = 0; j < plugin_.length; j++) {
        var mtt = plugin_.item(j)
        if (navigator.mimeTypes[mtt.type] == undefined) {
            navigator.mimeTypes[navigator.mimeTypes.temp] = mtt;
            Object.defineProperty(navigator.mimeTypes, mtt.type, {
                value: mtt
            })
            navigator.mimeTypes.temp++;
        }
    }

}
navigator.mimeTypes.length=navigator.mimeTypes.temp;
delete navigator.mimeTypes.temp
navigator.mimeTypes.__proto__ = MimeTypeArray.prototype;
navigator.mimeTypes = catvm.proxy(navigator.mimeTypes);


